Skip to content

test: Add concurrent fixture teardown test for Hypothesis #1190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pankaj-bind
Copy link

This PR improves test coverage for the Hypothesis integration by adding a new test case for concurrent fixture teardowns.

The new test_hypothesis_concurrent_fixture_teardown test validates that async fixtures with teardown logic behave correctly when run alongside other concurrent tasks. This helps ensure the robustness of pytest-asyncio's fixture management in complex, real-world scenarios.

To accommodate Hypothesis's health checks for function-scoped fixtures, the test is decorated with @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]).

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.38%. Comparing base (4fbe1e0) to head (e3b6a14).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1190      +/-   ##
==========================================
+ Coverage   88.88%   89.38%   +0.49%     
==========================================
  Files           2        2              
  Lines         405      405              
  Branches       44       44              
==========================================
+ Hits          360      362       +2     
+ Misses         35       34       -1     
+ Partials       10        9       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@seifertm seifertm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.

I'm not sure if the new test is worth adding.

@pankaj-bind Can you explain what prompted you to write it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants